import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from 'path';

export default defineConfig({
    plugins: [vue()],
    base: process.env.NODE_ENV === "production" ? "./" : "/",
    build: {
        outDir: 'docs' // 打包文件的输出目录
    },
    resolve: {
        alias: {
            '@': path.resolve(__dirname, './src'),
        }
    },
    server: {
        // https: true,
        port: 9999,
        proxy: {
            "/api": {
                target: "https://liu.myfristweb.com/api",
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, ""),
            },
        },
    },

});